﻿/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

CKEDITOR.editorConfig = function( config )
{
	config.language = 'zh-cn';
	config.baseFloatZIndex = 19900; 
	// 工具栏（基础'Basic'、全能'Full'、自定义）
	config.toolbar = 'Basic';
	config.toolbar = 'Full';
	
	config.toolbar_Full =
		[
			{ name: 'document', items : [ 'Source','-','NewPage','DocProps','Preview','Print','-','Templates' ] },
			{ name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
			{ name: 'editing', items : [ 'Find','Replace','-','SelectAll' ] },
			{ name: 'insert', items : [ 'Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe' ] },
			'/',
			{ name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
			{ name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv',
			'-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
			{ name: 'links', items : [ 'Link','Unlink','Anchor' ] },
			'/',
			{ name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] },
			{ name: 'colors', items : [ 'TextColor','BGColor' ] },
			{ name: 'tools', items : [ 'Maximize', 'ShowBlocks' ] }
		];
	
	//工具栏是否可以被收缩
    config.toolbarCanCollapse = true;

    //工具栏的位置
    config.toolbarLocation = 'top';//可选：bottom

    //工具栏默认是否展开
    config.toolbarStartupExpanded = true;

    // 取消 “拖拽以改变尺寸”功能 plugins/resize/plugin.js
    config.resize_enabled = false;
    
  //设置快捷键

    config.keystrokes = [
       [ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ], //获取焦点
       [ CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ], //元素焦点
       [ CKEDITOR.SHIFT + 121 /*F10*/, 'contextMenu' ], //文本菜单
       [ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ], //撤销
       [ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ], //重做
       [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'redo' ], //
       [ CKEDITOR.CTRL + 76 /*L*/, 'link' ], //链接
       [ CKEDITOR.CTRL + 66 /*B*/, 'bold' ], //粗体
       [ CKEDITOR.CTRL + 73 /*I*/, 'italic' ], //斜体
       [ CKEDITOR.CTRL + 85 /*U*/, 'underline' ], //下划线
       [ CKEDITOR.ALT + 109 /*-*/, 'toolbarCollapse' ]
    ];

    //设置快捷键 可能与浏览器快捷键冲突 plugins/keystrokes/plugin.js.
    config.blockedKeystrokes = [
        CKEDITOR.CTRL + 66 /*B*/,
        CKEDITOR.CTRL + 73 /*I*/,
        CKEDITOR.CTRL + 85 /*U*/
    ];
    
    //设置前景色的取值 plugins/colorbutton/plugin.js
    config.colorButton_colors = '000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,'
        	+ '006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,'
        	+ 'A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,'
        	+ 'FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';

    //是否在选择颜色时显示“其它颜色”选项 plugins/colorbutton/plugin.js
    config.colorButton_enableMore = true;

    //区块的前景色默认值设置 plugins/colorbutton/plugin.js
    config.colorButton_foreStyle = {
        element : 'span',
        styles : { 'color' : '#(color)' }
    };
    
    //上传图片
    config.filebrowserImageUploadUrl = '../admin/upload.jspx?index';
};
